﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using WMSADL.SY;
using WMSAML.SY;

namespace WMSABL.SY
{
    public class TUsers_BLL
    {
        TUsers_DAL dal_user = new TUsers_DAL();

        /// <summary>
        /// 
        /// </summary>
        public int Add_Users(TUsers_Entity entity)
        {
            return dal_user.Add_Users(entity);
        }

        /// <summary>
        /// 用户ID- 删除用户(修改用户状态)
        /// </summary>
        public bool Delete(int id)
        {
            return dal_user.Delete(id);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(TUsers_Entity entity)
        {
            return dal_user.Update(entity);
        }
        /// <summary>
        /// UpdateStatus
        /// </summary>
        public bool UpdateStatus(int status, int uid)
        {
            return dal_user.UpdateStatus(status, uid);
        }
        /// <summary>
        /// ByID
        /// </summary>
        public bool ExistsByID(int id)
        {
            return dal_user.ExistsByID(id);
        }

        /// <summary>
        /// By  O_ID
        /// </summary>
        public bool ExistsByOID(int oid)
        {
            return dal_user.ExistsByOID(oid);
        }

        /// <summary>
        /// 登录名是否存在
        /// </summary>
        public bool ExistsByName(string login_name)
        {
            return dal_user.ExistsByName(login_name);
        }

        /// <summary>
        /// 登录验证
        /// </summary>
        public bool Validate_Login(string loginName, string pwd)
        {
            return dal_user.Validate_Login(loginName, pwd);
        }

        /// <summary>
        /// 登录名-
        /// </summary>
        /// <summary>
        public TUsers_Entity GetEntityByName(string loginName)
        {
            return dal_user.GetEntityByName(loginName);
        }

        /// <summary>
        /// 用户ID-
        /// </summary>
        /// <summary>
        public TUsers_Entity GetEntityByID(int id)
        {
            return dal_user.GetEntityByID(id);
        }
        /// <summary>
        /// 用户ID-
        /// </summary>
        /// <summary>
        public Vlh_TUserRM_Entity GetEntityVByID(int id)
        {
            return dal_user.GetEntityVByID(id);
        }

        /// <summary>
        ///  用户名-
        /// </summary>
        /// <summary>
        public Vlh_TUserRM_Entity GetEntityVByUserName(string loginName)
        {
            return dal_user.GetEntityVByUserName(loginName);
        }

        /// <summary>
        /// ByO_id获得用户数据列表
        /// </summary>
        public DataSet GetList_TUsersByO_id(int id)
        {
            return dal_user.GetList_TUsersByO_id(id);
        }

        /// <summary>
        /// ByU_id获得用户数据列表（用户权限设计,获取用户对应的角色和组）
        /// </summary>
        public DataSet GetList_TUsersByU_id(int id, string username)
        {
            return dal_user.GetList_TUsersByU_id(id, username);
        }
    }
}
